package com.demo.aop;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestAopController {
    private static final Logger logger = LoggerFactory.getLogger(TestAopController.class);
    @RequestMapping("/testAop")
    public String getuser(@RequestParam String id) {
        logger.info("【执行实际方法】获取id: {}",id );
        int age =  Integer.valueOf(id); // 可能出现异常的地方，出发异常通知

        return "age=>"+age;
    }

}
